xpathRowData Property |
This is a string that denotes the XPath to a repetitive node that represents the topnode for each row. Usually, the repetitive node is the<tuple>node. This is a read-only property.
Syntax
Inline HTML |
<div cordysType="wcp.library.ui.XGrid" id=XGridID xpathRowData = sXPath xpathBusinessObject = ""> ... </div> |
Possible Values
Parameter | Description |
---|---|
sXPath | String that denotes a valid XPath to the node that is bound to the rows in the XGrid and is repeated in the XML content. |
Remarks
Consider the following XML response to a request for employees from the Northwind database.
<data> <GetEmployeesResponse xmlns="http://schemas.cordys.com/1.0/demo/northwind"> <tuple> <old> <Employees> <EmployeeID>1</EmployeeID> <FirstName>Nancy</FirstName> <LastName>Davolio</LastName> </Employees> </old> </tuple> <tuple> <old> <Employees> <EmployeeID>2</EmployeeID> <FirstName>Andrew</FirstName> <LastName>Fuller</LastName> </Employees> </old> </tuple> </GetEmployeesResponse> </data>
For each<tuple>, a row needs to be created in the XGrid.
However, a default namespace (xmlns) is specified on<GetEmployeesResponse>. All child nodes below theGetEmployeesResponsenode inherit this default namespace. You can also specify different namespaces for these nodes.
To obtain a valid XPath expression, a prefix needs to be applied for the namespace. For example, let us usenwdas a prefix ofhttp://schemas.cordys.com/1.0/demo/northwind. This can be done in the Internet Explorer as follows.
[dataXMLDocument].setProperty("SelectionNamespaces", "xmlns:nwd= 'http://schemas.cordys.com/1.0/demo/northwind'");
Therefore, the row added for a tuple is as follows:
xpathRowData = "data/nwd:GetEmployeesResponse/nwd:tuple"
Example
To view an example depicting the use of thexpathrowdataproperty, see the bindData() method.